#ifndef AUDIO_IN_H_
#define AUDIO_IN_H_

#include <iostream>
#include <vector>

#include <al/al.h>
#include <al/alc.h>

#include <windows.h>

#include "Buffer2.h"

#ifndef NULL
#define NULL 0
#endif /* NULL */

class IAudioIn
{
public:
	IAudioIn(IBuffer2*);
	~IAudioIn();
	char **detectDevice(void);
	void selectInDevice(char *);
	void selectInDevice(int);
	void autoSelectInDevice(void);
	void start(void);
	void stop(void);
	void setFrequency(unsigned int);
	void setReactivity(int);
	void runIn(void);
private:
	char			*_deviceList;
	char			**_deviceTable;
	ALCdevice		*_currentDevice;
	unsigned int	_freq; // 44100 : frequence d'echantillonage
	bool			_inRun;
	int				_sleepReactivity; // frequence d'envois au buffer
	IBuffer2			*_buf;
};

#endif
